#pragma once

#include "Matrix4.h"

namespace soft_renderer
{
	class Vector2;

	class Vector3
	{
	private:
		double data[3];

	public:
		Vector3(double x = 0, double y = 0, double z = 0);

		void set(double x, double y, double z);
		void setScalar(double scalar);
		void setX(double x);
		void setY(double y);
		void setZ(double z);
		void copy(const Vector3& v);
		double x();
		double y();
		double z();
		void add(const Vector3& v);
		void addVectors(const Vector3& a, const Vector3& b);
		void sub(const Vector3& v);
		void subVectors(const Vector3& a, const Vector3& b);
		void divideScalar(double scalar);
		void multiplyScalar(double scalar);
		void crossVectors(const Vector3& a, const Vector3& b);
		//void applyMatrix4(Matrix4& m);
		void applyMatrix4(const Matrix4& m);
		double lengthSq();
		double length();
		void normalize();
		Vector3 negated();
		double dot(const Vector3& v) const;

		friend class Vector2;
	};
}
